#coding=utf-8

# 
# Copyright(C) 2008 SupDo.com 
# Licensed under the GUN License, Version 3.0 (the "License"); 
#  
# File:        filters.py 
# Author:      欧大鹏
# Create Date: 2008-10-09 
# Description: 过滤器定义
# Modify Date: 2008-10-09

from babys import setting
from datetime import timedelta

from django.template import Library, defaultfilters
register = Library()

def datetz(value,arg): 
    tomezone = settings.TIME_ZONE 
    if '+' == tomezone[0] : 
        value += timedelta(seconds=int(tomezone)*60*60) 
    elif '-' == tomezone[0] : 
         value -= timedelta(seconds=int(tomezone)*60*60) 
  
    return defaultfilters.date(value, arg) 
  
register.filter(datetz) 


